package com.gy.niuer.service.impl;

import com.gy.niuer.domain.User;
import com.gy.niuer.mapper.UserMapper;
import com.gy.niuer.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserServiceImpl implements UserService {
    @Autowired
    private UserMapper userMapper;

    @Override
    public Boolean addUser(User user) {
        if(userMapper.selectUserById(user.getIdCard())!= null){
            return false;
        }
        userMapper.addUser(user);
        return true;
    }

    @Override
    public User queryUser(String id_card,String name) {
        User a = userMapper.queryUser(id_card, name);
        return a;
    }
}
